import { TBY } from '@/api/config/servicePort'
import http from '@/api'

/**教育资源 */
export namespace EducationResource {
  export interface Form {
    /**主键id */
    id: number
    /**观鸟课程数量*/
    birdCourse: number
    /**植物课程数量*/
    plantCourse: number
    /**自然保护课程数量*/
    naturalConservationCourse: number
    /**鸟类标本*/
    birdSpecimen: number
    /**昆虫标本*/
    insectSpecimen: number
    /**植物标本*/
    plantSpecimen: number
    /**两栖标本*/
    amphibiansSpecimen: number
    /**自然教育人员*/
    educationPerson: number
    /**志愿者*/
    volunteer: number
  }
}

/**
 * 查询附件
 * @param params：参数
 * @returns 结果
 */
export const getEducationResourceDetail = () => {
  return http.get<EducationResource.Form>(TBY + `/education_resource/detail`, {})
}

// 新增或修改课程
export const saveOrUpdateEducationResourceCourse = (params: Partial<EducationResource.Form>) => {
  return http.post(TBY + `/education_resource/course`, params)
}

// 新增或修改标本
export const saveOrUpdateEducationResourceSpecimen = (params: Partial<EducationResource.Form>) => {
  return http.post(TBY + `/education_resource/specimen`, params)
}

// 新增或修改人员
export const saveOrUpdateEducationResourcePerson = (params: Partial<EducationResource.Form>) => {
  return http.post(TBY + `/education_resource/person`, params)
}
